package reflect;

/**
 * 使用当前类测试反射机制
 */
@AutoRunClass
public class Person {
    private String name;
    private int age;

    public Person() {
    }

    public Person(String name) {
        this.name = name;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    @AutoRunMethod(name = "zhangsan ")
    public void sayHello(){
        System.out.println(name+"hello world");
    }
    @AutoRunMethod(name = "lisi")
    public void doSome(){
        System.out.println(name+"做某事");
    }
    @AutoRunMethod(name = "wangwu")
    public void sleep(){
        System.out.println(name+"睡了");
    }
    public void watchTV(){
        System.out.println(name+"看电视");
    }
    public void study(){
        System.out.println(name+"学习");
    }
    public void playGame(){
        System.out.println(name+"打游戏");
    }
    public void sing(){
        System.out.println(name+"唱歌");
    }
    public void say(String info){
        System.out.println(name+":"+info);
    }
    public void say(String info,int count){
        for (int i=0;i<count;i++){
            System.out.println(name+":"+info);
        }
    }
    public void hehe(){
        System.out.println("haha");
    }
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
